<div>
	<?php 
		include_once("config/database.php");
		if(isset($_REQUEST["p"]))
		{	
			$id = mysql_real_escape_string($_REQUEST["p"]);
			$db = new database();
			if($id=="latest")
			{
				$db->setQuery("SELECT * FROM posts GROUP BY id DESC LIMIT 0,1");
			}
			else
			{
				$db->setQuery("SELECT * FROM posts WHERE id=".$id);
			}
			$post = $db->fetchAll();	
			while($row = mysql_fetch_array($post))
			{
				echo "<p><span class='title'>Title: </span> <span class='title2'>".$row["title"]."</span></p>";	
				echo "<p><span class='created_date'>Posted in date: </span> <span class='created_date2'>".$row["date_created"]." </p>";	
				echo "<p>".$row["content"]." </p>";	
			}	
		}
	?>       
</div>